<div>
	<div class="brn-group pull-right">
		<button class="btn btn-default" ng-click="tableCtrl.add()" ng-disabled="tableCtrl.isAdding">
			<span class="glyphicon glyphicon-plus"></span>
		</button>
	</div>

	<table ng-table-dynamic="tableCtrl.tableParams with tableCtrl.cols" 
		class="table table-bordered editable-table" 
		  ng-form="tableCtrl.tableForm"
		  track-table="tableCtrl.tableTracker"
		  show-filter="false">
		<colgroup>
            <col ng-repeat="col in $columns" width="{{col.width}}"/>
		</colgroup>
		<tr ng-repeat="row in $data" ng-form="rowForm" track-table-row="row">
			<td ng-repeat="col in $columns" 
		   ng-class="rowForm[col.field].$dirty?'bg-warning':''"
			ng-form="{{col.field}}" 
			 track-table-cell>
				<span ng-if="col.dataType !== 'command' && !row.isEditing" class="editable-text">{{row[col.field]}}</span>
				<div ng-if="col.dataType !== 'command' && row.isEditing" 
					 class="controls" 
					 ng-class="rowForm[col.field].$invalid && rowForm[col.field].$dirty ? 'has-error' : ''" 
					ng-switch="col.dataType">
					<input ng-switch-default type="text" name="{{col.field}}" ng-model="row[col.field]" 
															   class="editable-input form-control input-sm" required />
					<input ng-switch-when="number" type="number" name="{{col.field}}" ng-model="row[col.field]" 
																	   class="editable-input form-control input-sm" required />
					<select ng-switch-when="select">
						<option>训练营</option>
						<option>活动课</option>
						<option>营列表</option>
					</select>
				</div>
				<div ng-if="col.dataType === 'command'">
					<button class="btn btn-primary btn-sm" ng-click="tableCtrl.save(row, rowForm)" ng-if="row.isEditing" 
																				 ng-disabled="rowForm.$pristine || rowForm.$invalid">
						<span class="glyphicon glyphicon-ok"></span>
					</button>
					<button class="btn btn-default btn-sm" ng-click="tableCtrl.cancel(row, rowForm)" ng-if="row.isEditing">
						<span class="glyphicon glyphicon-remove"></span>
					</button>
					<button class="btn btn-default btn-sm" ng-click="tableCtrl.edit(row)" ng-if="!row.isEditing">
						<span class="glyphicon glyphicon-pencil"></span>
					</button>
					<button class="btn btn-danger btn-sm" ng-click="tableCtrl.del(row)" ng-if="!row.isEditing">
						<span class="glyphicon glyphicon-trash"></span>
					</button>
				</div>
			</td>
			<!--
	   <td data-title="'Image'">{{row.img}}</td>
	   <td data-title="'URL'">{{row.url}}</td>
			-->
		</tr>
	</table>
</div>
<!--
	<tr ng-repeat="row in $data" ng-form="rowForm" demo-tracked-table-row="row">
	<td ng-repeat="col in $columns" ng-class="rowForm[col.field].$dirty ? 'bg-warning' : ''" ng-form="{{col.field}}" demo-tracked-table-cell>
	<span ng-if="col.dataType !== 'command' && !row.isEditing" class="editable-text">{{row[col.field]}}</span>
	<div ng-if="col.dataType !== 'command' && row.isEditing" class="controls" ng-class="rowForm[col.field].$invalid && rowForm[col.field].$dirty ? 'has-error' : ''" ng-switch="col.dataType">
	<input ng-switch-default type="text" name="{{col.field}}" ng-model="row[col.field]" class="editable-input form-control input-sm" required />
	<input ng-switch-when="number" type="number" name="{{col.field}}" ng-model="row[col.field]" class="editable-input form-control input-sm" required />
	</div>
	<div ng-if="col.dataType === 'command'">
	<button class="btn btn-primary btn-sm" ng-click="demo.save(row, rowForm)" ng-if="row.isEditing" ng-disabled="rowForm.$pristine || rowForm.$invalid"><span class="glyphicon glyphicon-ok"></span></button>
	<button class="btn btn-default btn-sm" ng-click="demo.cancel(row, rowForm)" ng-if="row.isEditing"><span class="glyphicon glyphicon-remove"></span></button>
	<button class="btn btn-default btn-sm" ng-click="row.isEditing = true" ng-if="!row.isEditing"><span class="glyphicon glyphicon-pencil"></span></button>
	<button class="btn btn-danger btn-sm" ng-click="demo.del(row)" ng-if="!row.isEditing"><span class="glyphicon glyphicon-trash"></span></button>
	</div>

	</td>
	</tr>
	</table>
	</div>
-->
